home *** CD-ROM | disk | FTP | other *** search
-
- SEMGET(2) UNIX Programmer's Manual SEMGET(2)
-
- NNAAMMEE
- sseemmggeett - get semaphore set
-
- SSYYNNOOPPSSIISS
- ##iinncclluuddee <<ssyyss//ttyyppeess..hh>>
- ##iinncclluuddee <<ssyyss//iippcc..hh>>
- ##iinncclluuddee <<ssyyss//sseemm..hh>>
-
- _i_n_t
- sseemmggeett(_k_e_y___t _k_e_y, _i_n_t _n_s_e_m_s, _i_n_t _s_e_m_f_l_g)
-
- DDEESSCCRRIIPPTTIIOONN
- The sseemmggeett() system call returns the semaphore identifier associated with
- _k_e_y.
-
- A new set containing _n_s_e_m_s semaphores is created if either _k_e_y is equal
- to IPC_PRIVATE, or _k_e_y does not have a semaphore set associated with it,
- and the IPC_CREAT bit is set in _m_s_g_f_l_g_.
-
- If a new set of semaphores is created, the data structure associated with
- it (the _s_e_m_i_d___d_s structure, see semctl(2)) is intialized as follows:
-
- ++oo _s_e_m___p_e_r_m_._c_u_i_d and _s_e_m___p_e_r_m_._u_i_d are set to the effective uid of the
- calling process.
-
- ++oo _s_e_m___p_e_r_m_._g_i_d and _s_e_m___p_e_r_m_._c_g_i_d are set to the effective gid of the
- calling process.
-
- ++oo _s_e_m___p_e_r_m_._m_o_d_e is set to the lower 9 bits of _m_s_g_f_l_g.
-
- ++oo _s_e_m___n_s_e_m_s is set to the value of _n_s_e_m_s
-
- ++oo _s_e_m___c_t_i_m_e is set to the current time
-
- ++oo _s_e_m___o_t_i_m_e is set to 0
-
- RREETTUURRNN VVAALLUUEESS
- sseemmggeett() returns a non-negative semaphore identifier if successful. Oth-
- erwise, -1 is returned and _e_r_r_n_o is set to reflect the error.
-
- EERRRROORRSS
- [EACCESS] The caller has no permission to access a semaphore set al-
- ready associated with _k_e_y_.
-
- [EEXIST] Both IPC_CREAT and IPC_EXCL are set in _m_s_g_f_l_g, and a
- semaphore set is already associated with _k_e_y.
-
- [EINVAL] _n_s_e_m_s is less than 0 or greater than the system limit for
- the number in a semaphore set.
-
- A semaphore set associated with _k_e_y exists, but has fewer
- semaphores than the number specified in _n_s_e_m_s.
-
- [ENOSPC] A new set of semaphores could not be created because the
- system limit for the number of semaphores or the number of
- semaphore sets has been reached.
-
- [ENOENT] IPC_CREAT was not set in _m_s_g_f_l_g and no semaphore set asso-
- ciated with _k_e_y was found.
-
- SSEEEE AALLSSOO
- semop(2) semctl(2)
-
-